﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xyz.BusinessObjects;
using Xyz.DataObjects.Interfaces;

namespace Xyz.DataObjects.Entity.Dao
{
    public class EntityAircraftDao : IAircraftDao
    {
        public Aircraft GetAircraftByAircraftId(int aircraftId)
        {
            using (var context = EntityObjectFactory.CreateContext())
            {
                var aircraft = context.Aircrafts.Single(x => x.AircraftId == aircraftId);

                return Mapper.Map(aircraft);
            }
        }
    }
}
